/*****************************************************
Copyright (C) 2020. All rights reserved.
File name     ：Graph.h
Version       ：v1.0
Author        ：zhengqijun
Date          ：2020-04-17
Function List ：
Description   ：Adjacency List
******************************************************/

#ifndef GRAPH_H_
#define GRAPH_H_

#define Infinity        (65535L)
#define UndirectedGraph

// Type Definition
struct GraphNode;
typedef char VertexType;
typedef int ArcType;
typedef struct GraphNode *Graph;

// Vertex&Arc Type Definition
struct ArcNode;
struct VertexNode;
typedef struct ArcNode *PtrToArcNode;
typedef PtrToArcNode ArcList;
typedef PtrToArcNode Position;
typedef struct VertexNode AdjList;

// Function Lists
Graph Initialize(void);
void MakeEmpty(Graph G);
void Destroy(Graph G);
int IsEmpty(Graph G);
int IsFull(Graph G);
void InsertVertex(VertexType V, Graph G);
void InsertArc(VertexType VS, VertexType VE, ArcType Weight, Graph G);
void RemoveVertex(VertexType V, Graph G);
void RemoveArc(VertexType VS, VertexType VE, Graph G);
int N(Graph G);
int E(Graph G);
ArcType Weight(VertexType VS, VertexType VE, Graph G);
VertexType Vertex(int Index, Graph G);
ArcList First(int Index, Graph G);
ArcList Next(ArcList L, Graph G);
int Index(ArcList L, Graph G);
ArcType ArcWeight(ArcList L, Graph G);

#endif  /* GRAPH_H_ */

// EOF

